<?
$length_of_preg = set_value('length_of_preg',$student->dhc_pregnancy_length);
$form_of_del = set_value('form_of_del',$student->dhc_delivery_form);
$complications = set_value('complications',$student->dhc_compications);
$go_to_bed = set_value('go_to_bed',$student->dhc_sleep_time);
$get_up_bed = set_value('get_up_bed',$student->dhc_wakup_time);
$sleeping_dist = set_value('sleeping_dist',$student->dhc_sleeping_disturbance_what);
$own_room = set_value('own_room',$student->dhc_child_own_room);
$room_shares = set_value('room_shares',$student->dhc_room_shares_who);
$wet_bed = set_value('wet_bed',$student->dhc_child_wet_bed);
$observable_difficulties = set_value('observable_difficulties',$student->dhc_defect_specify);
$observable_difficulties_since_when = set_value('observable_difficulties_since_when',$student->dhc_defect_when);
$observable_difficulties_action_taken = set_value('observable_difficulties_action_taken',$student->dhc_defect_actions);
$speech_problems = set_value('speech_problems',$student->dhc_speech_problem_what);
$speech_problems_since_when = set_value('speech_problems_since_when',$student->dhc_speech_problem_when);
$speech_problems_actions_taken = set_value('speech_problems_actions_taken',$student->dhc_speech_problem_actions);
$hearing_last_checked = set_value('hearing_last_checked',$student->dhc_hearing_last_check);
$hearing_problems = set_value('hearing_problems',$student->dhc_hearing_problems_what);
$hearing_problems_since_when = set_value('hearing_problems_since_when',$student->dhc_hearing_problems_when);
$hearing_problems_actions_taken = set_value('hearing_problems_actions_taken',$student->dhc_hearing_problem_actions);
$vision_last_checked = set_value('vision_last_checked',$student->dhc_vision_checked);
$vision_specify = set_value('vision_specify',$student->dhc_sight_problems_what);
$hinder_childs_learning = set_value('hinder_childs_learning',$student->dhc_hinder_learning_process);

//CHECK if value updated , if yes check if approve, denied  or pending
/*
 * Function located at parent_helper
 */

$profile_request = isset($profile_request) ? $profile_request : false;
$req_id = isset($req_id) ? $req_id : 0;

$is_length_of_preg = req_check_if_updated($req_id,'dhc_pregnancy_length',$student->dhc_pregnancy_length, $profile_request);
$is_form_of_del = req_check_if_updated($req_id,'dhc_delivery_form',$student->dhc_delivery_form, $profile_request);
$is_complications = req_check_if_updated($req_id,'dhc_compications',$student->dhc_compications, $profile_request);
$is_go_to_bed = req_check_if_updated($req_id,'dhc_sleep_time',$student->dhc_sleep_time, $profile_request);
$is_get_up_bed = req_check_if_updated($req_id,'dhc_wakup_time',$student->dhc_wakup_time, $profile_request);
$is_sleeping_dist = req_check_if_updated($req_id,'dhc_sleeping_disturbance_what',$student->dhc_sleeping_disturbance_what, $profile_request);
$is_own_room = req_check_if_updated($req_id,'dhc_child_own_room',$student->dhc_child_own_room, $profile_request);
$is_room_shares = req_check_if_updated($req_id,'dhc_room_shares_who',$student->dhc_room_shares_who, $profile_request);
$is_wet_bed = req_check_if_updated($req_id,'dhc_child_wet_bed',$student->dhc_child_wet_bed, $profile_request);
$is_observable_difficulties = req_check_if_updated($req_id,'dhc_defect_specify',$student->dhc_defect_specify, $profile_request);
$is_observable_difficulties_since_when = req_check_if_updated($req_id,'dhc_defect_when',$student->dhc_defect_when, $profile_request);
$is_observable_difficulties_action_taken = req_check_if_updated($req_id,'dhc_defect_actions',$student->dhc_defect_actions, $profile_request);
$is_speech_problems = req_check_if_updated($req_id,'dhc_speech_problem_what',$student->dhc_speech_problem_what, $profile_request);
$is_speech_problems_since_when = req_check_if_updated($req_id,'dhc_speech_problem_when',$student->dhc_speech_problem_when, $profile_request);
$is_speech_problems_actions_taken = req_check_if_updated($req_id,'dhc_speech_problem_actions',$student->dhc_speech_problem_actions, $profile_request);
$is_hearing_last_checked = req_check_if_updated($req_id,'dhc_hearing_last_check',$student->dhc_hearing_last_check, $profile_request);
$is_hearing_problems = req_check_if_updated($req_id,'dhc_hearing_problems_what',$student->dhc_hearing_problems_what, $profile_request);
$is_hearing_problems_since_when = req_check_if_updated($req_id,'dhc_hearing_problems_when',$student->dhc_hearing_problems_when, $profile_request);
$is_hearing_problems_actions_taken = req_check_if_updated($req_id,'dhc_hearing_problem_actions',$student->dhc_hearing_problem_actions, $profile_request);
$is_vision_last_checked = req_check_if_updated($req_id,'dhc_vision_checked',$student->dhc_vision_checked, $profile_request);
$is_vision_specify = req_check_if_updated($req_id,'dhc_sight_problems_what',$student->dhc_sight_problems_what, $profile_request);
$is_hinder_childs_learning = req_check_if_updated($req_id,'dhc_hinder_learning_process',$student->dhc_hinder_learning_process, $profile_request);

?>
<div>
	<?=form_open('',' class="custom profile_form" id ="developmental_history" ')?>
		<div>
			<div class="large-8 columns">
				<label class="radius secondary label">Length of Pregnancy</label> <?=$is_length_of_preg->checkbox?>
				<?=form_error('length_of_preg');?>
				<input class="<?=$is_length_of_preg->changed ? $is_length_of_preg->class : '' ?>" type="text" name="length_of_preg" value="<?=$length_of_preg;?>">
			</div>
			<div class="large-4 columns">
				<label class="radius secondary label">Form of Delivery</label> <?=$is_form_of_del->checkbox?>
				<?=form_error('form_of_del');?>
				<input class="<?=$is_form_of_del->changed ? $is_form_of_del->class : '' ?>" type="text" name="form_of_del" value="<?=$form_of_del;?>">
			</div>
		</div>
		<div>
			<label class="radius secondary label">Complications Before? during? after? delivery?</label> <?=$is_complications->checkbox?>
			<?=form_error('complications');?>
			<input class="<?=$is_complications->changed ? $is_complications->class : '' ?>" type="text" name="complications" value="<?=$complications;?>">
		</div>
		<div>
			<div class="large-6 columns">
				<label class="radius secondary label">What time does the child go to bed?</label> <?=$is_go_to_bed->checkbox?>
				<?=form_error('go_to_bed');?>
				<input class="<?=$is_go_to_bed->changed ? $is_go_to_bed->class : '' ?>" type="text" name="go_to_bed" value="<?=$go_to_bed;?>">
			</div>
			<div class="large-6 columns">
				<label class="radius secondary label">Get up from bed?</label> <?=$is_get_up_bed->checkbox?>
				<?=form_error('get_up_bed');?>
				<input class="<?=$is_get_up_bed->changed ? $is_get_up_bed->class : '' ?>" type="text" name="get_up_bed" value="<?=$get_up_bed;?>">
			</div>
		</div>
		<div>
			<label class="radius secondary label">Does the child have any sleeping disturbance? if yes what?</label> <?=$is_sleeping_dist->checkbox?>
			<?=form_error('sleeping_dist');?>
			<input class="<?=$is_sleeping_dist->changed ? $is_sleeping_dist->class : '' ?>" type="text" name="sleeping_dist" value="<?=$sleeping_dist;?>">
		</div>
		<div>
			<div class="large-6 columns">
				<label class="radius secondary label">Does the child have own room?</label> <?=$is_own_room->checkbox?>
				<? $dd_class = $is_own_room->changed ? $is_own_room->class : ''; ?>
				<?=form_error('own_room');?>
				<?=form_dropdown('own_room',array('yes'=>'Yes','no'=>'No'),$own_room, " class='$dd_class'");?>
			</div>
			<div class="large-6 columns">
				<label class="radius secondary label">If not, shares with whom?</label> <?=$is_room_shares->checkbox?>
				<?=form_error('room_shares');?>
				<input class="<?=$is_room_shares->changed ? $is_room_shares->class : '' ?>" type="text" name="room_shares" value="<?=$room_shares;?>">
			</div>
		</div>
		<div>
			<div class="large-4 columns">
				<label class="radius secondary label">Does the child bed wet?</label> <?=$is_wet_bed->checkbox?>
				<?=form_error('wet_bed');?>
				<input class="<?=$is_wet_bed->changed ? $is_wet_bed->class : '' ?>" type="text"  name="wet_bed" value="<?=$wet_bed;?>">
			</div>
			<div class="clearfix"></div>
		</div>
			<fieldset>
				<legend class="radius secondary label">Are there any observable difficulties or defects in you're child's growth?</legend>
				<div>
					<label class="radius secondary label">Specify:</label> <?=$is_observable_difficulties->checkbox?>
					<?=form_error('observable_difficulties');?>
					<input class="<?=$is_observable_difficulties->changed ? $is_observable_difficulties->class : '' ?>" type="text"  name="observable_difficulties" value="<?=$observable_difficulties;?>">
				</div>
				<div>
					<label class="radius secondary label">Since When?</label> <?=$is_observable_difficulties_since_when->checkbox?>
					<?=form_error('observable_difficulties_since_when');?>
					<input class="<?=$is_observable_difficulties_since_when->changed ? $is_observable_difficulties_since_when->class : '' ?>" type="text"  name="observable_difficulties_since_when" value="<?=$observable_difficulties_since_when;?>">
				</div>
				<div>
					<label class="radius secondary label">Action Taken:</label> <?=$is_observable_difficulties_action_taken->checkbox?>
					<?=form_error('observable_difficulties_action_taken');?>
					<input class="<?=$is_observable_difficulties_action_taken->changed ? $is_observable_difficulties_action_taken->class : '' ?>" type="text"  name="observable_difficulties_action_taken" value="<?=$observable_difficulties_action_taken;?>">
				</div>
			</fieldset>
			<fieldset>
				<legend class="radius secondary label">Are there any speech problems?</legend>
				<div>
					<label class="radius secondary label">Specify:</label> <?=$is_speech_problems->checkbox?>
					<?=form_error('speech_problems');?>
					<input class="<?=$is_speech_problems->changed ? $is_speech_problems->class : '' ?>" type="text"  name="speech_problems" value="<?=$speech_problems;?>">
				</div>
				<div>
					<label class="radius secondary label">Since When?</label> <?=$is_speech_problems_since_when->checkbox?>
					<?=form_error('speech_problems_since_when');?>
					<input class="<?=$is_speech_problems_since_when->changed ? $is_speech_problems_since_when->class : '' ?>" type="text"  name="speech_problems_since_when" value="<?=$speech_problems_since_when;?>">
				</div>
				<div>
					<label class="radius secondary label">Action Taken:</label> <?=$is_speech_problems_actions_taken->checkbox?>
					<?=form_error('speech_problems_actions_taken');?>
					<input class="<?=$is_speech_problems_actions_taken->changed ? $is_speech_problems_actions_taken->class : '' ?>" type="text"  name="speech_problems_actions_taken" value="<?=$speech_problems_actions_taken;?>">
				</div>
			</fieldset>
			
			<fieldset>
				<legend class="radius secondary label">Are there any hearing problems?</legend>
				<div>
					<label class="radius secondary label">When was the hearing of Child last checked?</label> <?=$is_hearing_last_checked->checkbox?>
					<?=form_error('hearing_last_checked');?>
					<input class="<?=$is_hearing_last_checked->changed ? $is_hearing_last_checked->class : '' ?>" type="text"  name="hearing_last_checked" value="<?=$hearing_last_checked;?>">
				</div>
				<div>
					<label class="radius secondary label">Specify:</label> <?=$is_hearing_problems->checkbox?>
					<?=form_error('hearing_problems');?>
					<input class="<?=$is_hearing_problems->changed ? $is_hearing_problems->class : '' ?>" type="text"  name="hearing_problems" value="<?=$hearing_problems;?>">
				</div>
				<div>
					<label class="radius secondary label">Since When?</label> <?=$is_hearing_problems_since_when->checkbox?>
					<?=form_error('hearing_problems_since_when');?>
					<input class="<?=$is_hearing_problems_since_when->changed ? $is_hearing_problems_since_when->class : '' ?>" type="text"  name="hearing_problems_since_when" value="<?=$hearing_problems_since_when;?>">
				</div>
				<div>
					<label class="radius secondary label">Action Taken:</label> <?=$is_hearing_problems_actions_taken->checkbox?>
					<?=form_error('hearing_problems_actions_taken');?>
					<input class="<?=$is_hearing_problems_actions_taken->changed ? $is_hearing_problems_actions_taken->class : '' ?>" type="text"  name="hearing_problems_actions_taken" value="<?=$hearing_problems_actions_taken;?>">
				</div>
			</fieldset>
			
			<fieldset>
				<legend class="radius secondary label">Are there any sight problems?</legend> 
				<div>
					<label class="radius secondary label">When was the vision of Child last checked?</label> <?=$is_vision_last_checked->checkbox?>
					<?=form_error('vision_last_checked');?>
					<input  class="<?=$is_vision_last_checked->changed ? $is_vision_last_checked->class : '' ?>" type="text"  name="vision_last_checked" value="<?=$vision_last_checked;?>">
				</div>
				<div>
					<label class="radius secondary label">Specify:</label> <?=$is_vision_specify->checkbox?>
					<?=form_error('vision_specify');?>
					<input class="<?=$is_vision_specify->changed ? $is_vision_specify->class : '' ?>" type="text"  name="vision_specify" value="<?=$vision_specify;?>">
				</div>
			</fieldset>
			
			<div>
				<label class="radius secondary label">Are there any information that we should be aware of that may hinder the child's <br> learning process or general development?</label> <?=$is_hinder_childs_learning->checkbox?>
				<?=form_error('hinder_childs_learning');?>
				<textarea class="<?=$is_hinder_childs_learning->changed ? $is_hinder_childs_learning->class : '' ?>" name="hinder_childs_learning"><?=$hinder_childs_learning;?></textarea>
			</div>
			<?/*if(isset($student->edit) && $student->edit === 1):?>
				<div>
					<input type="hidden" name="profile_id" value="<?=$student->profile_id;?>">
					<input type="hidden" name="enrollment_id" value="<?=$student->enrollment_id;?>">
					<input type="hidden" name="update_developmental_history" value="true">
					<input type="submit" name="update_developmental_history" value="Update Developmental History of Child" class="btn btn-primary">
				</div>
			<?endif*/?>
	</form>
</div>